﻿using System;
using System.Threading;
using System.Web.Mvc;

namespace IceDog.DNF.Program.Mvc5.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult GetTimeOut()
        {
            Thread.Sleep(3000);//添加延时
            return Content("time out");
        }

        // GET: GetTestView
        public ActionResult GetTestPartialView()
        {
            ViewBag.DateTime = DateTime.Now;
            ViewBag.DateTimeFrom = "from GetTestPartialView";
            ViewBag.PanelTitle = "title from GetTestPartialView";
            ViewBag.PanelContent = "content from GetTestPartialView";
            return View();
        }

        [ChildActionOnly]
        public ActionResult GetPartialPanel()
        {
            ViewBag.PanelTitle = "title from GetPartialPanel";
            ViewBag.PanelContent = "content from GetPartialPanel";
            return PartialView("_PartialPanel");
        }

        [ChildActionOnly]
        public ActionResult GetPartialDateTime()
        {
            ViewBag.DateTime = DateTime.Now.AddYears(1);
            ViewBag.DateTimeFrom = "from GetDateTime";
            return PartialView("_PartialDateTime");
        }
    }
}